<?php

namespace App\Http\Controllers\Admin;

use App\Model\User;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class UserController extends Controller
{
    /**
     * 用户列表
     */
    public function index(){
        $user = new User();
        $userInfo = $user->orderBy('id','desc')->get();
        return view('admin.user.index',['userInfo'=>$userInfo]);
    }
    /**
     * @param $id
     * @return mixed
     * 获取分类名称
     */
    static public function getUsername($id){
        $user = new User();
        $username = $user->where('id',$id)->first()->username;
        return $username;
    }
}
